home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gdb.idb / usr / freeware / info / gdb.info-4.z / gdb.info-4
Encoding:
GNU Info File  |  1998-10-28  |  48.3 KB  |  1,306 lines

  1. This is Info file ./gdb.info, produced by Makeinfo version 1.68 from
  2. the input file gdb.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Gdb: (gdb).                     The GNU debugger.
  6. END-INFO-DIR-ENTRY
  7.    This file documents the GNU debugger GDB.
  8.  
  9.    This is the Fifth Edition, April 1998, of `Debugging with GDB: the
  10. GNU Source-Level Debugger' for GDB Version .
  11.  
  12.    Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
  13. 1997, 1998 Free Software Foundation, Inc.
  14.  
  15.    Permission is granted to make and distribute verbatim copies of this
  16. manual provided the copyright notice and this permission notice are
  17. preserved on all copies.
  18.  
  19.    Permission is granted to copy and distribute modified versions of
  20. this manual under the conditions for verbatim copying, provided also
  21. that the entire resulting derived work is distributed under the terms
  22. of a permission notice identical to this one.
  23.  
  24.    Permission is granted to copy and distribute translations of this
  25. manual into another language, under the above conditions for modified
  26. versions.
  27.  
  28. 
  29. File: gdb.info,  Node: Print Settings,  Next: Value History,  Prev: Auto Display,  Up: Data
  30.  
  31. Print settings
  32. ==============
  33.  
  34.    GDB provides the following ways to control how arrays, structures,
  35. and symbols are printed.
  36.  
  37. These settings are useful for debugging programs in any language:
  38.  
  39. `set print address'
  40. `set print address on'
  41.      GDB prints memory addresses showing the location of stack traces,
  42.      structure values, pointer values, breakpoints, and so forth, even
  43.      when it also displays the contents of those addresses.  The default
  44.      is `on'.  For example, this is what a stack frame display looks
  45.      like with `set print address on':
  46.  
  47.           (gdb) f
  48.           #0  set_quotes (lq=0x34c78 "<<", rq=0x34c88 ">>")
  49.               at input.c:530
  50.           530         if (lquote != def_lquote)
  51.  
  52. `set print address off'
  53.      Do not print addresses when displaying their contents.  For
  54.      example, this is the same stack frame displayed with `set print
  55.      address off':
  56.  
  57.           (gdb) set print addr off
  58.           (gdb) f
  59.           #0  set_quotes (lq="<<", rq=">>") at input.c:530
  60.           530         if (lquote != def_lquote)
  61.  
  62.      You can use `set print address off' to eliminate all machine
  63.      dependent displays from the GDB interface.  For example, with
  64.      `print address off', you should get the same text for backtraces on
  65.      all machines--whether or not they involve pointer arguments.
  66.  
  67. `show print address'
  68.      Show whether or not addresses are to be printed.
  69.  
  70.    When GDB prints a symbolic address, it normally prints the closest
  71. earlier symbol plus an offset.  If that symbol does not uniquely
  72. identify the address (for example, it is a name whose scope is a single
  73. source file), you may need to clarify.  One way to do this is with
  74. `info line', for example `info line *0x4537'.  Alternately, you can set
  75. GDB to print the source file and line number when it prints a symbolic
  76. address:
  77.  
  78. `set print symbol-filename on'
  79.      Tell GDB to print the source file name and line number of a symbol
  80.      in the symbolic form of an address.
  81.  
  82. `set print symbol-filename off'
  83.      Do not print source file name and line number of a symbol.  This
  84.      is the default.
  85.  
  86. `show print symbol-filename'
  87.      Show whether or not GDB will print the source file name and line
  88.      number of a symbol in the symbolic form of an address.
  89.  
  90.    Another situation where it is helpful to show symbol filenames and
  91. line numbers is when disassembling code; GDB shows you the line number
  92. and source file that corresponds to each instruction.
  93.  
  94.    Also, you may wish to see the symbolic form only if the address being
  95. printed is reasonably close to the closest earlier symbol:
  96.  
  97. `set print max-symbolic-offset MAX-OFFSET'
  98.      Tell GDB to only display the symbolic form of an address if the
  99.      offset between the closest earlier symbol and the address is less
  100.      than MAX-OFFSET.  The default is 0, which tells GDB to always
  101.      print the symbolic form of an address if any symbol precedes it.
  102.  
  103. `show print max-symbolic-offset'
  104.      Ask how large the maximum offset is that GDB prints in a symbolic
  105.      address.
  106.  
  107.    If you have a pointer and you are not sure where it points, try `set
  108. print symbol-filename on'.  Then you can determine the name and source
  109. file location of the variable where it points, using `p/a POINTER'.
  110. This interprets the address in symbolic form.  For example, here GDB
  111. shows that a variable `ptt' points at another variable `t', defined in
  112. `hi2.c':
  113.  
  114.      (gdb) set print symbol-filename on
  115.      (gdb) p/a ptt
  116.      $4 = 0xe008 <t in hi2.c>
  117.  
  118.      *Warning:* For pointers that point to a local variable, `p/a' does
  119.      not show the symbol name and filename of the referent, even with
  120.      the appropriate `set print' options turned on.
  121.  
  122.    Other settings control how different kinds of objects are printed:
  123.  
  124. `set print array'
  125. `set print array on'
  126.      Pretty print arrays.  This format is more convenient to read, but
  127.      uses more space.  The default is off.
  128.  
  129. `set print array off'
  130.      Return to compressed format for arrays.
  131.  
  132. `show print array'
  133.      Show whether compressed or pretty format is selected for displaying
  134.      arrays.
  135.  
  136. `set print elements NUMBER-OF-ELEMENTS'
  137.      Set a limit on how many elements of an array GDB will print.  If
  138.      GDB is printing a large array, it stops printing after it has
  139.      printed the number of elements set by the `set print elements'
  140.      command.  This limit also applies to the display of strings.
  141.      Setting  NUMBER-OF-ELEMENTS to zero means that the printing is
  142.      unlimited.
  143.  
  144. `show print elements'
  145.      Display the number of elements of a large array that GDB will
  146.      print.  If the number is 0, then the printing is unlimited.
  147.  
  148. `set print null-stop'
  149.      Cause GDB to stop printing the characters of an array when the
  150.      first NULL is encountered.  This is useful when large arrays
  151.      actually contain only short strings.
  152.  
  153. `set print pretty on'
  154.      Cause GDB to print structures in an indented format with one member
  155.      per line, like this:
  156.  
  157.           $1 = {
  158.             next = 0x0,
  159.             flags = {
  160.               sweet = 1,
  161.               sour = 1
  162.             },
  163.             meat = 0x54 "Pork"
  164.           }
  165.  
  166. `set print pretty off'
  167.      Cause GDB to print structures in a compact format, like this:
  168.  
  169.           $1 = {next = 0x0, flags = {sweet = 1, sour = 1}, \
  170.           meat = 0x54 "Pork"}
  171.  
  172.      This is the default format.
  173.  
  174. `show print pretty'
  175.      Show which format GDB is using to print structures.
  176.  
  177. `set print sevenbit-strings on'
  178.      Print using only seven-bit characters; if this option is set, GDB
  179.      displays any eight-bit characters (in strings or character values)
  180.      using the notation `\'NNN.  This setting is best if you are
  181.      working in English (ASCII) and you use the high-order bit of
  182.      characters as a marker or "meta" bit.
  183.  
  184. `set print sevenbit-strings off'
  185.      Print full eight-bit characters.  This allows the use of more
  186.      international character sets, and is the default.
  187.  
  188. `show print sevenbit-strings'
  189.      Show whether or not GDB is printing only seven-bit characters.
  190.  
  191. `set print union on'
  192.      Tell GDB to print unions which are contained in structures.  This
  193.      is the default setting.
  194.  
  195. `set print union off'
  196.      Tell GDB not to print unions which are contained in structures.
  197.  
  198. `show print union'
  199.      Ask GDB whether or not it will print unions which are contained in
  200.      structures.
  201.  
  202.      For example, given the declarations
  203.  
  204.           typedef enum {Tree, Bug} Species;
  205.           typedef enum {Big_tree, Acorn, Seedling} Tree_forms;
  206.           typedef enum {Caterpillar, Cocoon, Butterfly}
  207.                         Bug_forms;
  208.           
  209.           struct thing {
  210.             Species it;
  211.             union {
  212.               Tree_forms tree;
  213.               Bug_forms bug;
  214.             } form;
  215.           };
  216.           
  217.           struct thing foo = {Tree, {Acorn}};
  218.  
  219.      with `set print union on' in effect `p foo' would print
  220.  
  221.           $1 = {it = Tree, form = {tree = Acorn, bug = Cocoon}}
  222.  
  223.      and with `set print union off' in effect it would print
  224.  
  225.           $1 = {it = Tree, form = {...}}
  226.  
  227. These settings are of interest when debugging C++ programs:
  228.  
  229. `set print demangle'
  230. `set print demangle on'
  231.      Print C++ names in their source form rather than in the encoded
  232.      ("mangled") form passed to the assembler and linker for type-safe
  233.      linkage.  The default is `on'.
  234.  
  235. `show print demangle'
  236.      Show whether C++ names are printed in mangled or demangled form.
  237.  
  238. `set print asm-demangle'
  239. `set print asm-demangle on'
  240.      Print C++ names in their source form rather than their mangled
  241.      form, even in assembler code printouts such as instruction
  242.      disassemblies.  The default is off.
  243.  
  244. `show print asm-demangle'
  245.      Show whether C++ names in assembly listings are printed in mangled
  246.      or demangled form.
  247.  
  248. `set demangle-style STYLE'
  249.      Choose among several encoding schemes used by different compilers
  250.      to represent C++ names.  The choices for STYLE are currently:
  251.  
  252.     `auto'
  253.           Allow GDB to choose a decoding style by inspecting your
  254.           program.
  255.  
  256.     `gnu'
  257.           Decode based on the GNU C++ compiler (`g++') encoding
  258.           algorithm.  This is the default.
  259.  
  260.     `lucid'
  261.           Decode based on the Lucid C++ compiler (`lcc') encoding
  262.           algorithm.
  263.  
  264.     `arm'
  265.           Decode using the algorithm in the `C++ Annotated Reference
  266.           Manual'.  *Warning:* this setting alone is not sufficient to
  267.           allow debugging `cfront'-generated executables.  GDB would
  268.           require further enhancement to permit that.
  269.  
  270.     `foo'
  271.           Show the list of formats.
  272.  
  273. `show demangle-style'
  274.      Display the encoding style currently in use for decoding C++
  275.      symbols.
  276.  
  277. `set print object'
  278. `set print object on'
  279.      When displaying a pointer to an object, identify the *actual*
  280.      (derived) type of the object rather than the *declared* type, using
  281.      the virtual function table.
  282.  
  283. `set print object off'
  284.      Display only the declared type of objects, without reference to the
  285.      virtual function table.  This is the default setting.
  286.  
  287. `show print object'
  288.      Show whether actual, or declared, object types are displayed.
  289.  
  290. `set print static-members'
  291. `set print static-members on'
  292.      Print static members when displaying a C++ object.  The default is
  293.      on.
  294.  
  295. `set print static-members off'
  296.      Do not print static members when displaying a C++ object.
  297.  
  298. `show print static-members'
  299.      Show whether C++ static members are printed, or not.
  300.  
  301. `set print vtbl'
  302. `set print vtbl on'
  303.      Pretty print C++ virtual function tables.  The default is off.
  304.  
  305. `set print vtbl off'
  306.      Do not pretty print C++ virtual function tables.
  307.  
  308. `show print vtbl'
  309.      Show whether C++ virtual function tables are pretty printed, or
  310.      not.
  311.  
  312. 
  313. File: gdb.info,  Node: Value History,  Next: Convenience Vars,  Prev: Print Settings,  Up: Data
  314.  
  315. Value history
  316. =============
  317.  
  318.    Values printed by the `print' command are saved in the GDB "value
  319. history".  This allows you to refer to them in other expressions.
  320. Values are kept until the symbol table is re-read or discarded (for
  321. example with the `file' or `symbol-file' commands).  When the symbol
  322. table changes, the value history is discarded, since the values may
  323. contain pointers back to the types defined in the symbol table.
  324.  
  325.    The values printed are given "history numbers" by which you can
  326. refer to them.  These are successive integers starting with one.
  327. `print' shows you the history number assigned to a value by printing
  328. `$NUM = ' before the value; here NUM is the history number.
  329.  
  330.    To refer to any previous value, use `$' followed by the value's
  331. history number.  The way `print' labels its output is designed to
  332. remind you of this.  Just `$' refers to the most recent value in the
  333. history, and `$$' refers to the value before that.  `$$N' refers to the
  334. Nth value from the end; `$$2' is the value just prior to `$$', `$$1' is
  335. equivalent to `$$', and `$$0' is equivalent to `$'.
  336.  
  337.    For example, suppose you have just printed a pointer to a structure
  338. and want to see the contents of the structure.  It suffices to type
  339.  
  340.      p *$
  341.  
  342.    If you have a chain of structures where the component `next' points
  343. to the next one, you can print the contents of the next one with this:
  344.  
  345.      p *$.next
  346.  
  347. You can print successive links in the chain by repeating this
  348. command--which you can do by just typing <RET>.
  349.  
  350.    Note that the history records values, not expressions.  If the value
  351. of `x' is 4 and you type these commands:
  352.  
  353.      print x
  354.      set x=5
  355.  
  356. then the value recorded in the value history by the `print' command
  357. remains 4 even though the value of `x' has changed.
  358.  
  359. `show values'
  360.      Print the last ten values in the value history, with their item
  361.      numbers.  This is like `p $$9' repeated ten times, except that
  362.      `show values' does not change the history.
  363.  
  364. `show values N'
  365.      Print ten history values centered on history item number N.
  366.  
  367. `show values +'
  368.      Print ten history values just after the values last printed.  If
  369.      no more values are available, `show values +' produces no display.
  370.  
  371.    Pressing <RET> to repeat `show values N' has exactly the same effect
  372. as `show values +'.
  373.  
  374. 
  375. File: gdb.info,  Node: Convenience Vars,  Next: Registers,  Prev: Value History,  Up: Data
  376.  
  377. Convenience variables
  378. =====================
  379.  
  380.    GDB provides "convenience variables" that you can use within GDB to
  381. hold on to a value and refer to it later.  These variables exist
  382. entirely within GDB; they are not part of your program, and setting a
  383. convenience variable has no direct effect on further execution of your
  384. program.  That is why you can use them freely.
  385.  
  386.    Convenience variables are prefixed with `$'.  Any name preceded by
  387. `$' can be used for a convenience variable, unless it is one of the
  388. predefined machine-specific register names (*note Registers::.).
  389. (Value history references, in contrast, are *numbers* preceded by `$'.
  390. *Note Value history: Value History.)
  391.  
  392.    You can save a value in a convenience variable with an assignment
  393. expression, just as you would set a variable in your program.  For
  394. example:
  395.  
  396.      set $foo = *object_ptr
  397.  
  398. would save in `$foo' the value contained in the object pointed to by
  399. `object_ptr'.
  400.  
  401.    Using a convenience variable for the first time creates it, but its
  402. value is `void' until you assign a new value.  You can alter the value
  403. with another assignment at any time.
  404.  
  405.    Convenience variables have no fixed types.  You can assign a
  406. convenience variable any type of value, including structures and
  407. arrays, even if that variable already has a value of a different type.
  408. The convenience variable, when used as an expression, has the type of
  409. its current value.
  410.  
  411. `show convenience'
  412.      Print a list of convenience variables used so far, and their
  413.      values.  Abbreviated `show con'.
  414.  
  415.    One of the ways to use a convenience variable is as a counter to be
  416. incremented or a pointer to be advanced.  For example, to print a field
  417. from successive elements of an array of structures:
  418.  
  419.      set $i = 0
  420.      print bar[$i++]->contents
  421.  
  422. Repeat that command by typing <RET>.
  423.  
  424.    Some convenience variables are created automatically by GDB and given
  425. values likely to be useful.
  426.  
  427. `$_'
  428.      The variable `$_' is automatically set by the `x' command to the
  429.      last address examined (*note Examining memory: Memory.).  Other
  430.      commands which provide a default address for `x' to examine also
  431.      set `$_' to that address; these commands include `info line' and
  432.      `info breakpoint'.  The type of `$_' is `void *' except when set
  433.      by the `x' command, in which case it is a pointer to the type of
  434.      `$__'.
  435.  
  436. `$__'
  437.      The variable `$__' is automatically set by the `x' command to the
  438.      value found in the last address examined.  Its type is chosen to
  439.      match the format in which the data was printed.
  440.  
  441. `$_exitcode'
  442.      The variable `$_exitcode' is automatically set to the exit code
  443.      when the program being debugged terminates.
  444.  
  445. 
  446. File: gdb.info,  Node: Registers,  Next: Floating Point Hardware,  Prev: Convenience Vars,  Up: Data
  447.  
  448. Registers
  449. =========
  450.  
  451.    You can refer to machine register contents, in expressions, as
  452. variables with names starting with `$'.  The names of registers are
  453. different for each machine; use `info registers' to see the names used
  454. on your machine.
  455.  
  456. `info registers'
  457.      Print the names and values of all registers except floating-point
  458.      registers (in the selected stack frame).
  459.  
  460. `info all-registers'
  461.      Print the names and values of all registers, including
  462.      floating-point registers.
  463.  
  464. `info registers REGNAME ...'
  465.      Print the "relativized" value of each specified register REGNAME.
  466.      As discussed in detail below, register values are normally
  467.      relative to the selected stack frame.  REGNAME may be any register
  468.      name valid on the machine you are using, with or without the
  469.      initial `$'.
  470.  
  471.    GDB has four "standard" register names that are available (in
  472. expressions) on most machines--whenever they do not conflict with an
  473. architecture's canonical mnemonics for registers.  The register names
  474. `$pc' and `$sp' are used for the program counter register and the stack
  475. pointer.  `$fp' is used for a register that contains a pointer to the
  476. current stack frame, and `$ps' is used for a register that contains the
  477. processor status.  For example, you could print the program counter in
  478. hex with
  479.  
  480.      p/x $pc
  481.  
  482. or print the instruction to be executed next with
  483.  
  484.      x/i $pc
  485.  
  486. or add four to the stack pointer(1) with
  487.  
  488.      set $sp += 4
  489.  
  490.    Whenever possible, these four standard register names are available
  491. on your machine even though the machine has different canonical
  492. mnemonics, so long as there is no conflict.  The `info registers'
  493. command shows the canonical names.  For example, on the SPARC, `info
  494. registers' displays the processor status register as `$psr' but you can
  495. also refer to it as `$ps'.
  496.  
  497.    GDB always considers the contents of an ordinary register as an
  498. integer when the register is examined in this way.  Some machines have
  499. special registers which can hold nothing but floating point; these
  500. registers are considered to have floating point values.  There is no way
  501. to refer to the contents of an ordinary register as floating point value
  502. (although you can *print* it as a floating point value with `print/f
  503. $REGNAME').
  504.  
  505.    Some registers have distinct "raw" and "virtual" data formats.  This
  506. means that the data format in which the register contents are saved by
  507. the operating system is not the same one that your program normally
  508. sees.  For example, the registers of the 68881 floating point
  509. coprocessor are always saved in "extended" (raw) format, but all C
  510. programs expect to work with "double" (virtual) format.  In such cases,
  511. GDB normally works with the virtual format only (the format that makes
  512. sense for your program), but the `info registers' command prints the
  513. data in both formats.
  514.  
  515.    Normally, register values are relative to the selected stack frame
  516. (*note Selecting a frame: Selection.).  This means that you get the
  517. value that the register would contain if all stack frames farther in
  518. were exited and their saved registers restored.  In order to see the
  519. true contents of hardware registers, you must select the innermost
  520. frame (with `frame 0').
  521.  
  522.    However, GDB must deduce where registers are saved, from the machine
  523. code generated by your compiler.  If some registers are not saved, or if
  524. GDB is unable to locate the saved registers, the selected stack frame
  525. makes no difference.
  526.  
  527. `set rstack_high_address ADDRESS'
  528.      On AMD 29000 family processors, registers are saved in a separate
  529.      "register stack".  There is no way for GDB to determine the extent
  530.      of this stack.  Normally, GDB just assumes that the stack is "large
  531.      enough".  This may result in GDB referencing memory locations that
  532.      do not exist.  If necessary, you can get around this problem by
  533.      specifying the ending address of the register stack with the `set
  534.      rstack_high_address' command.  The argument should be an address,
  535.      which you probably want to precede with `0x' to specify in
  536.      hexadecimal.
  537.  
  538. `show rstack_high_address'
  539.      Display the current limit of the register stack, on AMD 29000
  540.      family processors.
  541.  
  542.    ---------- Footnotes ----------
  543.  
  544.    (1) This is a way of removing one word from the stack, on machines
  545. where stacks grow downward in memory (most machines, nowadays).  This
  546. assumes that the innermost stack frame is selected; setting `$sp' is
  547. not allowed when other stack frames are selected.  To pop entire frames
  548. off the stack, regardless of machine architecture, use `return'; *note
  549. Returning from a function: Returning..
  550.  
  551. 
  552. File: gdb.info,  Node: Floating Point Hardware,  Prev: Registers,  Up: Data
  553.  
  554. Floating point hardware
  555. =======================
  556.  
  557.    Depending on the configuration, GDB may be able to give you more
  558. information about the status of the floating point hardware.
  559.  
  560. `info float'
  561.      Display hardware-dependent information about the floating point
  562.      unit.  The exact contents and layout vary depending on the
  563.      floating point chip.  Currently, `info float' is supported on the
  564.      ARM and x86 machines.
  565.  
  566. 
  567. File: gdb.info,  Node: Languages,  Next: Symbols,  Prev: Data,  Up: Top
  568.  
  569. Using GDB with Different Languages
  570. **********************************
  571.  
  572.    Although programming languages generally have common aspects, they
  573. are rarely expressed in the same manner.  For instance, in ANSI C,
  574. dereferencing a pointer `p' is accomplished by `*p', but in Modula-2,
  575. it is accomplished by `p^'.  Values can also be represented (and
  576. displayed) differently.  Hex numbers in C appear as `0x1ae', while in
  577. Modula-2 they appear as `1AEH'.
  578.  
  579.    Language-specific information is built into GDB for some languages,
  580. allowing you to express operations like the above in your program's
  581. native language, and allowing GDB to output values in a manner
  582. consistent with the syntax of your program's native language.  The
  583. language you use to build expressions is called the "working language".
  584.  
  585. * Menu:
  586.  
  587. * Setting::                     Switching between source languages
  588. * Show::                        Displaying the language
  589.  
  590. * Checks::                      Type and range checks
  591.  
  592. * Support::                     Supported languages
  593.  
  594. 
  595. File: gdb.info,  Node: Setting,  Next: Show,  Up: Languages
  596.  
  597. Switching between source languages
  598. ==================================
  599.  
  600.    There are two ways to control the working language--either have GDB
  601. set it automatically, or select it manually yourself.  You can use the
  602. `set language' command for either purpose.  On startup, GDB defaults to
  603. setting the language automatically.  The working language is used to
  604. determine how expressions you type are interpreted, how values are
  605. printed, etc.
  606.  
  607.    In addition to the working language, every source file that GDB
  608. knows about has its own working language.  For some object file
  609. formats, the compiler might indicate which language a particular source
  610. file is in.  However, most of the time GDB infers the language from the
  611. name of the file.  The language of a source file controls whether C++
  612. names are demangled--this way `backtrace' can show each frame
  613. appropriately for its own language.  There is no way to set the
  614. language of a source file from within GDB.
  615.  
  616.    This is most commonly a problem when you use a program, such as
  617. `cfront' or `f2c', that generates C but is written in another language.
  618. In that case, make the program use `#line' directives in its C output;
  619. that way GDB will know the correct language of the source code of the
  620. original program, and will display that source code, not the generated
  621. C code.
  622.  
  623. * Menu:
  624.  
  625. * Filenames::                   Filename extensions and languages.
  626. * Manually::                    Setting the working language manually
  627. * Automatically::               Having GDB infer the source language
  628.  
  629. 
  630. File: gdb.info,  Node: Filenames,  Next: Manually,  Up: Setting
  631.  
  632. List of filename extensions and languages
  633. -----------------------------------------
  634.  
  635.    If a source file name ends in one of the following extensions, then
  636. GDB infers that its language is the one indicated.
  637.  
  638. `.mod'
  639.      Modula-2 source file
  640.  
  641. `.c'
  642.      C source file
  643.  
  644. `.C'
  645. `.cc'
  646. `.cxx'
  647. `.cpp'
  648. `.cp'
  649. `.c++'
  650.      C++ source file
  651.  
  652. `.ch'
  653. `.c186'
  654. `.c286'
  655.      CHILL source file.
  656.  
  657. `.s'
  658. `.S'
  659.      Assembler source file.  This actually behaves almost like C, but
  660.      GDB does not skip over function prologues when stepping.
  661.  
  662. 
  663. File: gdb.info,  Node: Manually,  Next: Automatically,  Prev: Filenames,  Up: Setting
  664.  
  665. Setting the working language
  666. ----------------------------
  667.  
  668.    If you allow GDB to set the language automatically, expressions are
  669. interpreted the same way in your debugging session and your program.
  670.  
  671.    If you wish, you may set the language manually.  To do this, issue
  672. the command `set language LANG', where LANG is the name of a language,
  673. such as `c' or `modula-2'.  For a list of the supported languages, type
  674. `set language'.
  675.  
  676.    Setting the language manually prevents GDB from updating the working
  677. language automatically.  This can lead to confusion if you try to debug
  678. a program when the working language is not the same as the source
  679. language, when an expression is acceptable to both languages--but means
  680. different things.  For instance, if the current source file were
  681. written in C, and GDB was parsing Modula-2, a command such as:
  682.  
  683.      print a = b + c
  684.  
  685. might not have the effect you intended.  In C, this means to add `b'
  686. and `c' and place the result in `a'.  The result printed would be the
  687. value of `a'.  In Modula-2, this means to compare `a' to the result of
  688. `b+c', yielding a `BOOLEAN' value.
  689.  
  690. 
  691. File: gdb.info,  Node: Automatically,  Prev: Manually,  Up: Setting
  692.  
  693. Having GDB infer the source language
  694. ------------------------------------
  695.  
  696.    To have GDB set the working language automatically, use `set
  697. language local' or `set language auto'.  GDB then infers the working
  698. language.  That is, when your program stops in a frame (usually by
  699. encountering a breakpoint), GDB sets the working language to the
  700. language recorded for the function in that frame.  If the language for
  701. a frame is unknown (that is, if the function or block corresponding to
  702. the frame was defined in a source file that does not have a recognized
  703. extension), the current working language is not changed, and GDB issues
  704. a warning.
  705.  
  706.    This may not seem necessary for most programs, which are written
  707. entirely in one source language.  However, program modules and libraries
  708. written in one source language can be used by a main program written in
  709. a different source language.  Using `set language auto' in this case
  710. frees you from having to set the working language manually.
  711.  
  712. 
  713. File: gdb.info,  Node: Show,  Next: Checks,  Prev: Setting,  Up: Languages
  714.  
  715. Displaying the language
  716. =======================
  717.  
  718.    The following commands help you find out which language is the
  719. working language, and also what language source files were written in.
  720.  
  721. `show language'
  722.      Display the current working language.  This is the language you
  723.      can use with commands such as `print' to build and compute
  724.      expressions that may involve variables in your program.
  725.  
  726. `info frame'
  727.      Display the source language for this frame.  This language becomes
  728.      the working language if you use an identifier from this frame.
  729.      *Note Information about a frame: Frame Info, to identify the other
  730.      information listed here.
  731.  
  732. `info source'
  733.      Display the source language of this source file.  *Note Examining
  734.      the Symbol Table: Symbols, to identify the other information
  735.      listed here.
  736.  
  737. 
  738. File: gdb.info,  Node: Checks,  Next: Support,  Prev: Show,  Up: Languages
  739.  
  740. Type and range checking
  741. =======================
  742.  
  743.      *Warning:* In this release, the GDB commands for type and range
  744.      checking are included, but they do not yet have any effect.  This
  745.      section documents the intended facilities.
  746.  
  747.    Some languages are designed to guard you against making seemingly
  748. common errors through a series of compile- and run-time checks.  These
  749. include checking the type of arguments to functions and operators, and
  750. making sure mathematical overflows are caught at run time.  Checks such
  751. as these help to ensure a program's correctness once it has been
  752. compiled by eliminating type mismatches, and providing active checks
  753. for range errors when your program is running.
  754.  
  755.    GDB can check for conditions like the above if you wish.  Although
  756. GDB does not check the statements in your program, it can check
  757. expressions entered directly into GDB for evaluation via the `print'
  758. command, for example.  As with the working language, GDB can also
  759. decide whether or not to check automatically based on your program's
  760. source language.  *Note Supported languages: Support, for the default
  761. settings of supported languages.
  762.  
  763. * Menu:
  764.  
  765. * Type Checking::               An overview of type checking
  766. * Range Checking::              An overview of range checking
  767.  
  768. 
  769. File: gdb.info,  Node: Type Checking,  Next: Range Checking,  Up: Checks
  770.  
  771. An overview of type checking
  772. ----------------------------
  773.  
  774.    Some languages, such as Modula-2, are strongly typed, meaning that
  775. the arguments to operators and functions have to be of the correct type,
  776. otherwise an error occurs.  These checks prevent type mismatch errors
  777. from ever causing any run-time problems.  For example,
  778.  
  779.      1 + 2 => 3
  780. but
  781.      error--> 1 + 2.3
  782.  
  783.    The second example fails because the `CARDINAL' 1 is not
  784. type-compatible with the `REAL' 2.3.
  785.  
  786.    For the expressions you use in GDB commands, you can tell the GDB
  787. type checker to skip checking; to treat any mismatches as errors and
  788. abandon the expression; or to only issue warnings when type mismatches
  789. occur, but evaluate the expression anyway.  When you choose the last of
  790. these, GDB evaluates expressions like the second example above, but
  791. also issues a warning.
  792.  
  793.    Even if you turn type checking off, there may be other reasons
  794. related to type that prevent GDB from evaluating an expression.  For
  795. instance, GDB does not know how to add an `int' and a `struct foo'.
  796. These particular type errors have nothing to do with the language in
  797. use, and usually arise from expressions, such as the one described
  798. above, which make little sense to evaluate anyway.
  799.  
  800.    Each language defines to what degree it is strict about type.  For
  801. instance, both Modula-2 and C require the arguments to arithmetical
  802. operators to be numbers.  In C, enumerated types and pointers can be
  803. represented as numbers, so that they are valid arguments to mathematical
  804. operators.  *Note Supported languages: Support, for further details on
  805. specific languages.
  806.  
  807.    GDB provides some additional commands for controlling the type
  808. checker:
  809.  
  810. `set check type auto'
  811.      Set type checking on or off based on the current working language.
  812.      *Note Supported languages: Support, for the default settings for
  813.      each language.
  814.  
  815. `set check type on'
  816. `set check type off'
  817.      Set type checking on or off, overriding the default setting for the
  818.      current working language.  Issue a warning if the setting does not
  819.      match the language default.  If any type mismatches occur in
  820.      evaluating an expression while typechecking is on, GDB prints a
  821.      message and aborts evaluation of the expression.
  822.  
  823. `set check type warn'
  824.      Cause the type checker to issue warnings, but to always attempt to
  825.      evaluate the expression.  Evaluating the expression may still be
  826.      impossible for other reasons.  For example, GDB cannot add numbers
  827.      and structures.
  828.  
  829. `show type'
  830.      Show the current setting of the type checker, and whether or not
  831.      GDB is setting it automatically.
  832.  
  833. 
  834. File: gdb.info,  Node: Range Checking,  Prev: Type Checking,  Up: Checks
  835.  
  836. An overview of range checking
  837. -----------------------------
  838.  
  839.    In some languages (such as Modula-2), it is an error to exceed the
  840. bounds of a type; this is enforced with run-time checks.  Such range
  841. checking is meant to ensure program correctness by making sure
  842. computations do not overflow, or indices on an array element access do
  843. not exceed the bounds of the array.
  844.  
  845.    For expressions you use in GDB commands, you can tell GDB to treat
  846. range errors in one of three ways: ignore them, always treat them as
  847. errors and abandon the expression, or issue warnings but evaluate the
  848. expression anyway.
  849.  
  850.    A range error can result from numerical overflow, from exceeding an
  851. array index bound, or when you type a constant that is not a member of
  852. any type.  Some languages, however, do not treat overflows as an error.
  853. In many implementations of C, mathematical overflow causes the result
  854. to "wrap around" to lower values--for example, if M is the largest
  855. integer value, and S is the smallest, then
  856.  
  857.      M + 1 => S
  858.  
  859.    This, too, is specific to individual languages, and in some cases
  860. specific to individual compilers or machines.  *Note Supported
  861. languages: Support, for further details on specific languages.
  862.  
  863.    GDB provides some additional commands for controlling the range
  864. checker:
  865.  
  866. `set check range auto'
  867.      Set range checking on or off based on the current working language.
  868.      *Note Supported languages: Support, for the default settings for
  869.      each language.
  870.  
  871. `set check range on'
  872. `set check range off'
  873.      Set range checking on or off, overriding the default setting for
  874.      the current working language.  A warning is issued if the setting
  875.      does not match the language default.  If a range error occurs,
  876.      then a message is printed and evaluation of the expression is
  877.      aborted.
  878.  
  879. `set check range warn'
  880.      Output messages when the GDB range checker detects a range error,
  881.      but attempt to evaluate the expression anyway.  Evaluating the
  882.      expression may still be impossible for other reasons, such as
  883.      accessing memory that the process does not own (a typical example
  884.      from many Unix systems).
  885.  
  886. `show range'
  887.      Show the current setting of the range checker, and whether or not
  888.      it is being set automatically by GDB.
  889.  
  890. 
  891. File: gdb.info,  Node: Support,  Prev: Checks,  Up: Languages
  892.  
  893. Supported languages
  894. ===================
  895.  
  896.    GDB 4 supports C, C++, and Modula-2.  Some GDB features may be used
  897. in expressions regardless of the language you use: the GDB `@' and `::'
  898. operators, and the `{type}addr' construct (*note Expressions:
  899. Expressions.) can be used with the constructs of any supported language.
  900.  
  901.    The following sections detail to what degree each source language is
  902. supported by GDB.  These sections are not meant to be language
  903. tutorials or references, but serve only as a reference guide to what the
  904. GDB expression parser accepts, and what input and output formats should
  905. look like for different languages.  There are many good books written
  906. on each of these languages; please look to these for a language
  907. reference or tutorial.
  908.  
  909. * Menu:
  910.  
  911. * C::                           C and C++
  912. * Modula-2::                    Modula-2
  913.  
  914. 
  915. File: gdb.info,  Node: C,  Next: Modula-2,  Up: Support
  916.  
  917. C and C++
  918. ---------
  919.  
  920.    Since C and C++ are so closely related, many features of GDB apply
  921. to both languages.  Whenever this is the case, we discuss those
  922. languages together.
  923.  
  924.    The C++ debugging facilities are jointly implemented by the GNU C++
  925. compiler and GDB.  Therefore, to debug your C++ code effectively, you
  926. must compile your C++ programs with the GNU C++ compiler, `g++'.
  927.  
  928.    For best results when debugging C++ programs, use the stabs debugging
  929. format.  You can select that format explicitly with the `g++'
  930. command-line options `-gstabs' or `-gstabs+'.  See *Note Options for
  931. Debugging Your Program or GNU CC: (gcc.info)Debugging Options, for more
  932. information.
  933.  
  934. * Menu:
  935.  
  936. * C Operators::                 C and C++ operators
  937. * C Constants::                 C and C++ constants
  938. * Cplus expressions::           C++ expressions
  939. * C Defaults::                  Default settings for C and C++
  940.  
  941. * C Checks::                    C and C++ type and range checks
  942.  
  943. * Debugging C::                 GDB and C
  944. * Debugging C plus plus::       Special features for C++
  945.  
  946. 
  947. File: gdb.info,  Node: C Operators,  Next: C Constants,  Up: C
  948.  
  949. C and C++ operators
  950. ...................
  951.  
  952.    Operators must be defined on values of specific types.  For instance,
  953. `+' is defined on numbers, but not on structures.  Operators are often
  954. defined on groups of types.
  955.  
  956.    For the purposes of C and C++, the following definitions hold:
  957.  
  958.    * *Integral types* include `int' with any of its storage-class
  959.      specifiers; `char'; and `enum'.
  960.  
  961.    * *Floating-point types* include `float' and `double'.
  962.  
  963.    * *Pointer types* include all types defined as `(TYPE *)'.
  964.  
  965.    * *Scalar types* include all of the above.
  966.  
  967. The following operators are supported.  They are listed here in order
  968. of increasing precedence:
  969.  
  970. `,'
  971.      The comma or sequencing operator.  Expressions in a
  972.      comma-separated list are evaluated from left to right, with the
  973.      result of the entire expression being the last expression
  974.      evaluated.
  975.  
  976. `='
  977.      Assignment.  The value of an assignment expression is the value
  978.      assigned.  Defined on scalar types.
  979.  
  980. `OP='
  981.      Used in an expression of the form `A OP= B', and translated to
  982.      `A = A OP B'.  `OP=' and `=' have the same precendence.  OP is any
  983.      one of the operators `|', `^', `&', `<<', `>>', `+', `-', `*',
  984.      `/', `%'.
  985.  
  986. `?:'
  987.      The ternary operator.  `A ? B : C' can be thought of as:  if A
  988.      then B else C.  A should be of an integral type.
  989.  
  990. `||'
  991.      Logical OR.  Defined on integral types.
  992.  
  993. `&&'
  994.      Logical AND.  Defined on integral types.
  995.  
  996. `|'
  997.      Bitwise OR.  Defined on integral types.
  998.  
  999. `^'
  1000.      Bitwise exclusive-OR.  Defined on integral types.
  1001.  
  1002. `&'
  1003.      Bitwise AND.  Defined on integral types.
  1004.  
  1005. `==, !='
  1006.      Equality and inequality.  Defined on scalar types.  The value of
  1007.      these expressions is 0 for false and non-zero for true.
  1008.  
  1009. `<, >, <=, >='
  1010.      Less than, greater than, less than or equal, greater than or equal.
  1011.      Defined on scalar types.  The value of these expressions is 0 for
  1012.      false and non-zero for true.
  1013.  
  1014. `<<, >>'
  1015.      left shift, and right shift.  Defined on integral types.
  1016.  
  1017. `@'
  1018.      The GDB "artificial array" operator (*note Expressions:
  1019.      Expressions.).
  1020.  
  1021. `+, -'
  1022.      Addition and subtraction.  Defined on integral types,
  1023.      floating-point types and pointer types.
  1024.  
  1025. `*, /, %'
  1026.      Multiplication, division, and modulus.  Multiplication and
  1027.      division are defined on integral and floating-point types.
  1028.      Modulus is defined on integral types.
  1029.  
  1030. `++, --'
  1031.      Increment and decrement.  When appearing before a variable, the
  1032.      operation is performed before the variable is used in an
  1033.      expression; when appearing after it, the variable's value is used
  1034.      before the operation takes place.
  1035.  
  1036. `*'
  1037.      Pointer dereferencing.  Defined on pointer types.  Same precedence
  1038.      as `++'.
  1039.  
  1040. `&'
  1041.      Address operator.  Defined on variables.  Same precedence as `++'.
  1042.  
  1043.      For debugging C++, GDB implements a use of `&' beyond what is
  1044.      allowed in the C++ language itself: you can use `&(&REF)' (or, if
  1045.      you prefer, simply `&&REF') to examine the address where a C++
  1046.      reference variable (declared with `&REF') is stored.
  1047.  
  1048. `-'
  1049.      Negative.  Defined on integral and floating-point types.  Same
  1050.      precedence as `++'.
  1051.  
  1052. `!'
  1053.      Logical negation.  Defined on integral types.  Same precedence as
  1054.      `++'.
  1055.  
  1056. `~'
  1057.      Bitwise complement operator.  Defined on integral types.  Same
  1058.      precedence as `++'.
  1059.  
  1060. `., ->'
  1061.      Structure member, and pointer-to-structure member.  For
  1062.      convenience, GDB regards the two as equivalent, choosing whether
  1063.      to dereference a pointer based on the stored type information.
  1064.      Defined on `struct' and `union' data.
  1065.  
  1066. `[]'
  1067.      Array indexing.  `A[I]' is defined as `*(A+I)'.  Same precedence
  1068.      as `->'.
  1069.  
  1070. `()'
  1071.      Function parameter list.  Same precedence as `->'.
  1072.  
  1073. `::'
  1074.      C++ scope resolution operator.  Defined on `struct', `union', and
  1075.      `class' types.
  1076.  
  1077. `::'
  1078.      Doubled colons also represent the GDB scope operator (*note
  1079.      Expressions: Expressions.).  Same precedence as `::', above.
  1080.  
  1081. 
  1082. File: gdb.info,  Node: C Constants,  Next: Cplus expressions,  Prev: C Operators,  Up: C
  1083.  
  1084. C and C++ constants
  1085. ...................
  1086.  
  1087.    GDB allows you to express the constants of C and C++ in the
  1088. following ways:
  1089.  
  1090.    * Integer constants are a sequence of digits.  Octal constants are
  1091.      specified by a leading `0' (i.e. zero), and hexadecimal constants
  1092.      by a leading `0x' or `0X'.  Constants may also end with a letter
  1093.      `l', specifying that the constant should be treated as a `long'
  1094.      value.
  1095.  
  1096.    * Floating point constants are a sequence of digits, followed by a
  1097.      decimal point, followed by a sequence of digits, and optionally
  1098.      followed by an exponent.  An exponent is of the form:
  1099.      `e[[+]|-]NNN', where NNN is another sequence of digits.  The `+'
  1100.      is optional for positive exponents.
  1101.  
  1102.    * Enumerated constants consist of enumerated identifiers, or their
  1103.      integral equivalents.
  1104.  
  1105.    * Character constants are a single character surrounded by single
  1106.      quotes (`''), or a number--the ordinal value of the corresponding
  1107.      character (usually its ASCII value).  Within quotes, the single
  1108.      character may be represented by a letter or by "escape sequences",
  1109.      which are of the form `\NNN', where NNN is the octal representation
  1110.      of the character's ordinal value; or of the form `\X', where `X'
  1111.      is a predefined special character--for example, `\n' for newline.
  1112.  
  1113.    * String constants are a sequence of character constants surrounded
  1114.      by double quotes (`"').
  1115.  
  1116.    * Pointer constants are an integral value.  You can also write
  1117.      pointers to constants using the C operator `&'.
  1118.  
  1119.    * Array constants are comma-separated lists surrounded by braces `{'
  1120.      and `}'; for example, `{1,2,3}' is a three-element array of
  1121.      integers, `{{1,2}, {3,4}, {5,6}}' is a three-by-two array, and
  1122.      `{&"hi", &"there", &"fred"}' is a three-element array of pointers.
  1123.  
  1124. 
  1125. File: gdb.info,  Node: Cplus expressions,  Next: C Defaults,  Prev: C Constants,  Up: C
  1126.  
  1127. C++ expressions
  1128. ...............
  1129.  
  1130.    GDB expression handling has a number of extensions to interpret a
  1131. significant subset of C++ expressions.
  1132.  
  1133.      *Warning:* GDB can only debug C++ code if you compile with the GNU
  1134.      C++ compiler.  Moreover, C++ debugging depends on the use of
  1135.      additional debugging information in the symbol table, and thus
  1136.      requires special support.  GDB has this support *only* with the
  1137.      stabs debug format.  In particular, if your compiler generates
  1138.      a.out, MIPS ECOFF, RS/6000 XCOFF, or ELF with stabs extensions to
  1139.      the symbol table, these facilities are all available.  (With GNU
  1140.      CC, you can use the `-gstabs' option to request stabs debugging
  1141.      extensions explicitly.)  Where the object code format is standard
  1142.      COFF or DWARF in ELF, on the other hand, most of the C++ support
  1143.      in GDB does *not* work.
  1144.  
  1145.   1. Member function calls are allowed; you can use expressions like
  1146.  
  1147.           count = aml->GetOriginal(x, y)
  1148.  
  1149.   2. While a member function is active (in the selected stack frame),
  1150.      your expressions have the same namespace available as the member
  1151.      function; that is, GDB allows implicit references to the class
  1152.      instance pointer `this' following the same rules as C++.
  1153.  
  1154.   3. You can call overloaded functions; GDB resolves the function call
  1155.      to the right definition, with one restriction--you must use
  1156.      arguments of the type required by the function that you want to
  1157.      call.  GDB does not perform conversions requiring constructors or
  1158.      user-defined type operators.
  1159.  
  1160.   4. GDB understands variables declared as C++ references; you can use
  1161.      them in expressions just as you do in C++ source--they are
  1162.      automatically dereferenced.
  1163.  
  1164.      In the parameter list shown when GDB displays a frame, the values
  1165.      of reference variables are not displayed (unlike other variables);
  1166.      this avoids clutter, since references are often used for large
  1167.      structures.  The *address* of a reference variable is always
  1168.      shown, unless you have specified `set print address off'.
  1169.  
  1170.   5. GDB supports the C++ name resolution operator `::'--your
  1171.      expressions can use it just as expressions in your program do.
  1172.      Since one scope may be defined in another, you can use `::'
  1173.      repeatedly if necessary, for example in an expression like
  1174.      `SCOPE1::SCOPE2::NAME'.  GDB also allows resolving name scope by
  1175.      reference to source files, in both C and C++ debugging (*note
  1176.      Program variables: Variables.).
  1177.  
  1178. 
  1179. File: gdb.info,  Node: C Defaults,  Next: C Checks,  Prev: Cplus expressions,  Up: C
  1180.  
  1181. C and C++ defaults
  1182. ..................
  1183.  
  1184.    If you allow GDB to set type and range checking automatically, they
  1185. both default to `off' whenever the working language changes to C or
  1186. C++.  This happens regardless of whether you or GDB selects the working
  1187. language.
  1188.  
  1189.    If you allow GDB to set the language automatically, it recognizes
  1190. source files whose names end with `.c', `.C', or `.cc', and when GDB
  1191. enters code compiled from one of these files, it sets the working
  1192. language to C or C++.  *Note Having GDB infer the source language:
  1193. Automatically, for further details.
  1194.  
  1195. 
  1196. File: gdb.info,  Node: C Checks,  Next: Debugging C,  Prev: C Defaults,  Up: C
  1197.  
  1198. C and C++ type and range checks
  1199. ...............................
  1200.  
  1201.    By default, when GDB parses C or C++ expressions, type checking is
  1202. not used.  However, if you turn type checking on, GDB considers two
  1203. variables type equivalent if:
  1204.  
  1205.    * The two variables are structured and have the same structure,
  1206.      union, or enumerated tag.
  1207.  
  1208.    * The two variables have the same type name, or types that have been
  1209.      declared equivalent through `typedef'.
  1210.  
  1211.    Range checking, if turned on, is done on mathematical operations.
  1212. Array indices are not checked, since they are often used to index a
  1213. pointer that is not itself an array.
  1214.  
  1215. 
  1216. File: gdb.info,  Node: Debugging C,  Next: Debugging C plus plus,  Prev: C Checks,  Up: C
  1217.  
  1218. GDB and C
  1219. .........
  1220.  
  1221.    The `set print union' and `show print union' commands apply to the
  1222. `union' type.  When set to `on', any `union' that is inside a `struct'
  1223. or `class' is also printed.  Otherwise, it appears as `{...}'.
  1224.  
  1225.    The `@' operator aids in the debugging of dynamic arrays, formed
  1226. with pointers and a memory allocation function.  *Note Expressions:
  1227. Expressions.
  1228.  
  1229. 
  1230. File: gdb.info,  Node: Debugging C plus plus,  Prev: Debugging C,  Up: C
  1231.  
  1232. GDB features for C++
  1233. ....................
  1234.  
  1235.    Some GDB commands are particularly useful with C++, and some are
  1236. designed specifically for use with C++.  Here is a summary:
  1237.  
  1238. `breakpoint menus'
  1239.      When you want a breakpoint in a function whose name is overloaded,
  1240.      GDB breakpoint menus help you specify which function definition
  1241.      you want.  *Note Breakpoint menus: Breakpoint Menus.
  1242.  
  1243. `rbreak REGEX'
  1244.      Setting breakpoints using regular expressions is helpful for
  1245.      setting breakpoints on overloaded functions that are not members
  1246.      of any special classes.  *Note Setting breakpoints: Set Breaks.
  1247.  
  1248. `catch EXCEPTIONS'
  1249. `info catch'
  1250.      Debug C++ exception handling using these commands.  *Note
  1251.      Breakpoints and exceptions: Exception Handling.
  1252.  
  1253. `ptype TYPENAME'
  1254.      Print inheritance relationships as well as other information for
  1255.      type TYPENAME.  *Note Examining the Symbol Table: Symbols.
  1256.  
  1257. `set print demangle'
  1258. `show print demangle'
  1259. `set print asm-demangle'
  1260. `show print asm-demangle'
  1261.      Control whether C++ symbols display in their source form, both when
  1262.      displaying code as C++ source and when displaying disassemblies.
  1263.      *Note Print settings: Print Settings.
  1264.  
  1265. `set print object'
  1266. `show print object'
  1267.      Choose whether to print derived (actual) or declared types of
  1268.      objects.  *Note Print settings: Print Settings.
  1269.  
  1270. `set print vtbl'
  1271. `show print vtbl'
  1272.      Control the format for printing virtual function tables.  *Note
  1273.      Print settings: Print Settings.
  1274.  
  1275. `Overloaded symbol names'
  1276.      You can specify a particular definition of an overloaded symbol,
  1277.      using the same notation that is used to declare such symbols in
  1278.      C++: type `SYMBOL(TYPES)' rather than just SYMBOL.  You can also
  1279.      use the GDB command-line word completion facilities to list the
  1280.      available choices, or to finish the type list for you.  *Note
  1281.      Command completion: Completion, for details on how to do this.
  1282.  
  1283. 
  1284. File: gdb.info,  Node: Modula-2,  Prev: C,  Up: Support
  1285.  
  1286. Modula-2
  1287. --------
  1288.  
  1289.    The extensions made to GDB to support Modula-2 only support output
  1290. from the GNU Modula-2 compiler (which is currently being developed).
  1291. Other Modula-2 compilers are not currently supported, and attempting to
  1292. debug executables produced by them is most likely to give an error as
  1293. GDB reads in the executable's symbol table.
  1294.  
  1295. * Menu:
  1296.  
  1297. * M2 Operators::                Built-in operators
  1298. * Built-In Func/Proc::           Built-in functions and procedures
  1299. * M2 Constants::                Modula-2 constants
  1300. * M2 Defaults::                 Default settings for Modula-2
  1301. * Deviations::                  Deviations from standard Modula-2
  1302. * M2 Checks::                   Modula-2 type and range checks
  1303. * M2 Scope::                    The scope operators `::' and `.'
  1304. * GDB/M2::                      GDB and Modula-2
  1305.  
  1306.